$(function () { 
    var getQueryVariable = function getQueryVariable(variable) {
        var query = window.location.search.slice(1);
        var vars = query.split('&');
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split('=');
            if (decodeURIComponent(pair[0]) == variable) {
                return decodeURIComponent(pair[1]);
            }
        }
        console.log('Query variable %s not found', variable);
    };
    var productid = getQueryVariable("productid");
   
    $.ajax({
        type: "get",
        url: "http://193.112.55.79:9090/api/getdiscountproduct",
        data:  { 'productid': productid },
        dataType: "json",
        success: function (res) {
            console.log(res);
            
            var html=template('detailTemp',res)
            // console.log(html);
            $('.detailList').html(html)
            
        }
    });


 })
